﻿using System;

namespace Ornithopter.FlashDiskHelper
{
	/// <summary>
	/// ItemView1.xaml 的交互逻辑
	/// </summary>
    public partial class ItemView1 : ItemViewControlBase
	{
		public ItemView1(LogicalDisk logicalDisk):base(logicalDisk)
		{
			this.InitializeComponent();
		}

        public override System.Windows.Controls.Primitives.ButtonBase EjectButton
        {
            get { return this.btn_Close; }
        }

        protected override void InitiateUI()
        {
            this.txtVolumName.Text = LogicalDisk.Properties.VolumName;
            this.txtCaption.Text = LogicalDisk.Properties.Caption;

            this.indicator.Max = LogicalDisk.Properties.Size;
            this.indicator.Value = LogicalDisk.Properties.Size - LogicalDisk.Properties.FreeSpace;

            this.txtSize.Text = String.Format("可用:{0}"
                , ByteConventer.Convert(LogicalDisk.Properties.FreeSpace, null));
            this.txtSize2.Text = String.Format("总共:{0}"
               , ByteConventer.Convert(LogicalDisk.Properties.Size, null));
            
        }

        public override System.Windows.Controls.Primitives.ButtonBase OpenButton
        {
            get { return this.btn_Open; }
        }
    }
}